<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const xxx = '200812';
    const xx = '2008.1.2';
    const c = xx.replace(new RegExp(","), '-')
    const x = xxx.replace(/^(\d{4})/g, '$1/')
    console.log(x);
    console.log(Number(xx));
    var regex =/\//;
    // var regex =/^$/;
    console.log(regex.test('sa/ucxs'));    //true
    console.log(regex.test('123saucxs4560'));
  </script>
</body>

</html>